package gamesys.games.particlesystem.effects
{
	import gamesys.games.particlesystem.core.ParticleData;
	import gamesys.games.particlesystem.utils.Range;

	/**
	 * @author robertthurston
	 */
	public class GravityEffect implements IEffect
	{
		private var _gravity:Range;

		public function GravityEffect(range:Range)
		{
			_gravity = range;
		}

		public function reset(particleData:ParticleData):void
		{
			particleData.gravity = _gravity.range;
		}

		public function update(particleData:ParticleData):void
		{
			particleData.ySpeed += particleData.gravity;
		}
	}
}
